﻿@model internal_website.Models.Composer
@using internal_website.Views.Resources
@using internal_website.CustomHtmlHelper
@{
    ViewBag.Title = ViewString.Composer_Section_Information_Title;
    var controllerName = HttpContext.Current.Request.RequestContext.RouteData.Values["controller"].ToString();
    var tableID = "tbl" + controllerName;
    var tableSelector = "#" + tableID;
}

@section Information
{
}

@section colLeft
{
     <fieldset>
        <legend>@ViewString.Composer_Index_Title</legend>
        <table id="@tableID" class="table table-striped table-bordered" width="100%">
            <thead>
                <tr>
                    <th>@Html.DisplayNameFor(model => model.Id)</th> @*The column "ID" should always be leftmost. This will always be hidden and populated by AJAX*@
                    <th>@Html.DisplayNameFor(model => model.Active)</th>
                    <th>@Html.DisplayNameFor(model => model.LastName)</th>
                    <th>@Html.DisplayNameFor(model => model.FirstName)</th>
                </tr>
            </thead>
            <tbody>
            </tbody>
        </table>

         <div class="control-group"> 
             <div class="controls pull-right">
                 <button id="btnCreateNew" class="btn btn-success btnCreateNew">@ViewString.Composer_Index_btnCreateNew_html</button>
             </div>
         </div>
    </fieldset>
}

@section colRight
{
}

@section scripts
{
    
    <script>
        var colLeftSelector = '#colLeft';
        var colRightSelector = '#colRight';

        var dataTablesSelector = '@tableSelector';
        var dataTablesAjaxSource = '@Url.Action("DataTablesAjaxHandler", "Composer")';
        var dataTablesAoColumns = [{ 'bVisible': false }, { 'bVisible': false }, null, null];

        var dataTables_mnuCrudHeaderText    = ' @ViewString.Composer_Index_jscrptVar_dataTables_mnuCrudHeaderText';
        var dataTables_mnuCrudDeleteText    = ' @ViewString.Composer_Index_jscrptVar_dataTables_mnuCrudDeleteText';
        var dataTables_mnuCrudEditText      = ' @ViewString.Composer_Index_jscrptVar_dataTables_mnuCrudEditText';
        var dataTables_mnuCrudDetailsText   = ' @ViewString.Composer_Index_jscrptVar_dataTables_mnuCrudDetailsText';

        
        var urlController_EmptyFormWithAntiForgeryToken = '@Url.Action("Get_EmptyFormWithAntiForgeryToken", "Composer")';
        var urlController_Create = '@Url.Action("_Create", "Composer")';
        var urlController_CreateSubmit ='@Url.Action("Create", "Composer")';
        var urlController_DeleteSubmit = '@Url.Action("Delete", "Composer")';
        var deleteConfirmDialogParams = {   'heading': '@ViewString.Composer_Index_jscrptVar_deleteConfirmDialogParams_heading',
                                            'question': '@ViewString.Composer_Index_jscrptVar_deleteConfirmDialogParams_question',
                                            'cancelBtnTxt': '@ViewString.Composer_Index_jscrptVar_deleteConfirmDialogParams_cancelBtnTxt',
                                            'okBtnTxt': '@ViewString.Composer_Index_jscrptVar_deleteConfirmDialogParams_okBtnTxt'
                                        };
        var urlController_Details = '@Url.Action("_Details", "Composer")';
        var urlController_Edit = '@Url.Action("_Edit", "Composer")';
        var urlController_EditSubmit = '@Url.Action("Edit", "Composer")';
            
        var btlPage = new PageButler(colLeftSelector, colRightSelector,
                                     dataTablesSelector, dataTablesAjaxSource, dataTablesAoColumns, dataTables_mnuCrudHeaderText, dataTables_mnuCrudDeleteText, dataTables_mnuCrudEditText, dataTables_mnuCrudDetailsText,
                                     urlController_Create, urlController_CreateSubmit, urlController_DeleteSubmit, deleteConfirmDialogParams, urlController_Details, urlController_EmptyFormWithAntiForgeryToken, urlController_Edit, urlController_EditSubmit);

       
    </script>

}